package com.cxx.purchasecharge.component.bean;

import java.util.List;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.URL;

import com.cxx.purchasecharge.core.model.CustomerTypeCode;

/**
 * 客户
 */
public class CustomerBean extends BaseBean
{
    private static final long serialVersionUID = 1L;

    @NotEmpty
    private String shortName;
    private CustomerTypeCode typeCode = CustomerTypeCode.CUSTOMER;
    private List <PaymentBean> paymentBeans;
    private String companyName;
    private String companyIntroduction;
    /**
     * 公司地址
     */
    private String address;
    private String zipCode;
    @Email
    private String email;
    private String fax;
    /**
     * 公司固话
     */
    private String fixedPhone;

    private boolean isDeleted = false;
    /**
     * 人员规模
     */
    private String scale;

    /**
     * 意向产品
     */
    //@NotEmpty
    private String goodsIntention;
    /**
     * 公司法人
     */
    private String legalPerson;
    /**
     * 会员帐号
     */
    private String memberAccount;
    /**
     * 公司网址
     */
    @URL
    private String webSite;
    /**
     * 公司注册日期
     */
    private String regDate;
    /**
     * 公司注册资金
     */
    private String regFund;

    /**
     * 公司所在区域：如，湖南-永州-东安-白牙市镇
     */
    private String region;

    private String comment;

    @NotEmpty
    private String userSignedTo;
    private String userCreated;
    private String userUpdated;
    private boolean sharable = false;

    private List <ContactBean> contactBeans;
    /**
     * 欠款
     */
    private float dealMoney;

    public CustomerBean ()
    {
    }

    public CustomerBean (String shortName)
    {
        this.shortName = shortName;
    }

    public String getShortName ()
    {
        return shortName;
    }

    public void setShortName (String shortName)
    {
        this.shortName = shortName;
    }

    public String getAddress ()
    {
        return address;
    }

    public void setAddress (String address)
    {
        this.address = address;
    }

    public String getEmail ()
    {
        return email;
    }

    public void setEmail (String email)
    {
        this.email = email;
    }

    public String getFixedPhone ()
    {
        return fixedPhone;
    }

    public void setFixedPhone (String fixedPhone)
    {
        this.fixedPhone = fixedPhone;
    }

    public String getFax ()
    {
        return fax;
    }

    public void setFax (String fax)
    {
        this.fax = fax;
    }

    public boolean isDeleted ()
    {
        return isDeleted;
    }

    public void setDeleted (boolean isDeleted)
    {
        this.isDeleted = isDeleted;
    }

    public String getScale ()
    {
        return scale;
    }

    public void setScale (String scale)
    {
        this.scale = scale;
    }

    public String getGoodsIntention ()
    {
        return goodsIntention;
    }

    public void setGoodsIntention (String goodsIntention)
    {
        this.goodsIntention = goodsIntention;
    }

    public String getLegalPerson ()
    {
        return legalPerson;
    }

    public void setLegalPerson (String legalPerson)
    {
        this.legalPerson = legalPerson;
    }

    public String getMemberAccount ()
    {
        return memberAccount;
    }

    public void setMemberAccount (String memberAccount)
    {
        this.memberAccount = memberAccount;
    }

    public String getRegDate ()
    {
        return regDate;
    }

    public void setRegDate (String regDate)
    {
        this.regDate = regDate;
    }

    public String getRegFund ()
    {
        return regFund;
    }

    public void setRegFund (String regFund)
    {
        this.regFund = regFund;
    }

    public String getRegion ()
    {
        return region;
    }

    public void setRegion (String region)
    {
        this.region = region;
    }

    public CustomerTypeCode getTypeCode ()
    {
        return typeCode;
    }

    public void setTypeCode (CustomerTypeCode typeCode)
    {
        this.typeCode = typeCode;
    }

    public String getCompanyName ()
    {
        return companyName;
    }

    public void setCompanyName (String companyName)
    {
        this.companyName = companyName;
    }

    public String getCompanyIntroduction ()
    {
        return companyIntroduction;
    }

    public void setCompanyIntroduction (String companyIntroduction)
    {
        this.companyIntroduction = companyIntroduction;
    }

    public String getZipCode ()
    {
        return zipCode;
    }

    public void setZipCode (String zipCode)
    {
        this.zipCode = zipCode;
    }

    public String getWebSite ()
    {
        return webSite;
    }

    public void setWebSite (String webSite)
    {
        this.webSite = webSite;
    }

    public String getComment ()
    {
        return comment;
    }

    public void setComment (String comment)
    {
        this.comment = comment;
    }

    public String getUserSignedTo ()
    {
        return userSignedTo;
    }

    public void setUserSignedTo (String userSignedTo)
    {
        this.userSignedTo = userSignedTo;
    }

    public String getUserCreated ()
    {
        return userCreated;
    }

    public void setUserCreated (String userCreated)
    {
        this.userCreated = userCreated;
    }

    public String getUserUpdated ()
    {
        return userUpdated;
    }

    public void setUserUpdated (String userUpdated)
    {
        this.userUpdated = userUpdated;
    }

    public boolean isSharable ()
    {
        return sharable;
    }

    public void setSharable (boolean sharable)
    {
        this.sharable = sharable;
    }

    public List <ContactBean> getContactBeans ()
    {
        return contactBeans;
    }

    public void setContactBeans (List <ContactBean> contactBeans)
    {
        this.contactBeans = contactBeans;
    }

    public List <PaymentBean> getPaymentBeans ()
    {
        return paymentBeans;
    }

    public void setPaymentBeans (List <PaymentBean> paymentBeans)
    {
        this.paymentBeans = paymentBeans;
        if (null != paymentBeans)
        {
            for (PaymentBean paymentBean : paymentBeans)
            {
                paymentBean.setCustomerId (this.getId ());
            }
        }
    }

    public float getDealMoney ()
    {
        return dealMoney;
    }

    public void setDealMoney (float dealMoney)
    {
        this.dealMoney = dealMoney;
    }

}
